home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6605 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.8 KB  |  68 lines

  1. Path: nyssa.swt.edu!kv09845
  2. From: kv09845@nyssa.swt.edu (They Run, Sheep To The Fold)
  3. Newsgroups: comp.lang.c
  4. Subject: ERR with typedef...lvalue
  5. Date: 15 Feb 96 19:01:09 CST
  6. Organization: Southwest Texas State University
  7. Message-ID: <1996Feb15.190109@nyssa.swt.edu>
  8. NNTP-Posting-Host: nyssa.swt.edu
  9.  
  10.  
  11. The following is a program I can't seem to get to compile. It keeps giving me
  12. an error. Would anyone happen to know why. I'm sure it's simple, but then, so
  13. am I. Any help greatly appreciated.
  14.  
  15. THE SOURCE CODE:
  16. ----------------
  17.  
  18. #include <stdio.h>
  19.  
  20. main ()
  21. {
  22.     typedef char STRING[81];
  23.  
  24.     STRING text, input_line;
  25.  
  26.     text = "this is the text string";
  27.     input_line = "this is the input_line string";
  28.     
  29.     printf("%s\n", text);
  30.     printf("%s\n", input_line);
  31.     
  32. }
  33.  
  34. THE .LIS FILE FROM THE COMPILER (DEC C):
  35. ----------------------------------------
  36.  
  37.                                 Source Listing                  15-FEB-1996 18:56:35    DEC C V5.2-003                  Page 1         
  38.                                                                 15-FEB-1996 18:56:25    DISK$A4:[KV09845.C]TEST.C;4
  39.  
  40.           1 
  41.           2 #include <stdio.h>
  42.         676 
  43.         677 main ()
  44.         678 {
  45.         679     typedef char STRING[81];
  46.         680 
  47.         681     STRING text, input_line;
  48.         682 
  49.         683     text = "this is the text string";
  50.         ....1                                 
  51. %CC-E-NEEDLVALUE, (1) In this statement, "text" is not an lvalue, but occurs 
  52. in a context that requires one.
  53.  
  54.         684     input_line = "this is the input_line string";
  55.         ....1                                             
  56. %CC-E-NEEDLVALUE, (1) In this statement, "input_line" is not an lvalue, but 
  57. occurs in a context that requires one.
  58.  
  59.         685     
  60.         686     printf("%s\n", text);
  61.         687     printf("%s\n", input_line);
  62.         688     
  63.         689 }
  64.         690 
  65.         691 
  66.  
  67.  
  68.